package collectionTest;

import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.List;

import org.junit.Before;
import org.junit.Test;

public class JunitListTest {
	
	private List<String> nameList;
	
	@Before
	public void init(){//初始化方法，进行每个测试之前都要先执行一遍
		nameList= new ArrayList<>();
		for (int i = 0; i < 10; i++) {
			nameList.add("b");
		}
		for (int i = 0; i < 10; i++) {
			nameList.add("a");
		}
	}

	@Test
	public void test1() {
		nameList.clear();
		nameList.forEach(System.out::print);
		System.out.println();
		
	}
	
	@Test
	public void test2() {
		nameList.forEach(System.out::print);
		System.out.println();
		
	}

}
